$(document).ready(function () { // Define the maintenance window (start and end date) var now = new Date(); var start = new Date('2026-07-29T00:00:00'); var end = new Date('2026-09-01T23:59:59'); // Check if the current time is within the defined maintenance period var isWithinDate = now >= start && now <= end; // Check if the current page is the single checkout page (EN or DE) var isOnCheckoutPage = window.location.href.includes("single_checkout.aspx"); // Only proceed if both date and page match if (isWithinDate && isOnCheckoutPage) { // Select the real checkout button (both English and German label) var realBtn = document.querySelector("input[type='submit'][value='Checkout'], input[type='submit'][value='Kasse']"); if (realBtn) { // Ensure the parent container is relatively positioned (required for tooltip positioning) var parent = realBtn.parentNode; parent.style.position = "relative"; // Clone the real button to create a fake disabled one var cloneBtn = realBtn.cloneNode(true); cloneBtn.disabled = true; // make it visually disabled cloneBtn.removeAttribute("onclick"); // prevent any attached JS action cloneBtn.removeAttribute("id"); // avoid duplicate IDs cloneBtn.removeAttribute("name"); // avoid being submitted in forms cloneBtn.style.cursor = "not-allowed"; // show blocked cursor on hover // Hide the real button so it cannot be triggered realBtn.style.display = "none"; // Insert the fake button into the DOM parent.appendChild(cloneBtn); // Create the tooltip with maintenance explanation in EN + DE (plain text) var hoverNotice = document.createElement("div"); hoverNotice.innerHTML = `
EN: Ordering is unavailable.
DE: Bestellungen sind nicht möglich.
`; // Style the tooltip block hoverNotice.style.cssText = ` display: none; position: absolute; bottom: 100%; left: 0; width: 100%; background: #fff; color: #333; border: 1px solid #ccc; padding: 10px; border-radius: 4px; font-size: 14px; text-align: left; margin-bottom: 8px; box-shadow: 0 2px 6px rgba(0,0,0,0.1); z-index: 9999; `; // Add the tooltip above the button parent.appendChild(hoverNotice); // Show tooltip on hover $(cloneBtn).on("mouseenter", function () { $(hoverNotice).stop(true, true).fadeIn(150); }).on("mouseleave", function () { $(hoverNotice).stop(true, true).fadeOut(150); }); } } });